import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:ljy_p_app/localization/localization_message.dart';
import 'package:ljy_p_app/pages/common/user_theme_controller.dart';
import 'package:ljy_p_app/routes/lj_routes.dart';

class LjLaunch extends StatelessWidget {
  LjLaunch({super.key});

  final UserThemeController themeController = Get.put(UserThemeController());

  @override
  Widget build(BuildContext context) {
    return Obx(() {
      Widget app = GetMaterialApp(
      debugShowCheckedModeBanner: false,
      theme: themeController.currentTheme,
      initialRoute: LjRoutes.welcome,
      getPages: LjRoutes.getPages,
      translations: LocalizationMessage(),
      locale: const Locale('zh', 'CN'),
      fallbackLocale: const Locale('zh', 'CN'),
    );
    if (themeController.isGreyMode.value) {
      app = ColorFiltered(colorFilter: ColorFilter.mode(Colors.grey, BlendMode.saturation), child: app);
    }
    return app;
    });
  }
}